package naruto.datastructures.criteria;

/**
 *
 * @author nacuong
 */
public class InstructionCriterion extends Criterion{
  String className;
  String methodName;
  int offset;
  
  public InstructionCriterion(String className, String methodName, int offset){
    this.className = className;
    this.methodName = methodName;
    this.offset = offset;
  }

  @Override
  public boolean equals(Object insnCriterion){
    return insnCriterion instanceof InstructionCriterion
            && this.className.equals(((InstructionCriterion)insnCriterion).getClassName())
            && this.methodName.equals(((InstructionCriterion)insnCriterion).getMethodName())
            && this.offset == ((InstructionCriterion)insnCriterion).getOffset();
  }

  public String getClassName(){
    return this.className;
  }

  public String getMethodName(){
    return this.methodName;
  }

  public int getOffset(){
    return this.offset;
  }

  @Override
  public String toString(){
    return className + ":" + methodName + ":" + offset;
  }
}
